import Vue from 'vue'
import Router from 'vue-router'
import Cargo from '@/components/cargo'
import Login from '@/components/login'
import User from '@/components/cargo/user'
import Password from '@/components/cargo/password'

Vue.use(Router)

export const titleMap = {
  person: {
    title: '个人中心',
    icon: 'fa fa-user-o'
  },
  user: {
    title: '用户管理',
    icon: 'el-icon-setting'
  }
}

export const routerMap = {
  user: {
    path: 'user',
    name: 'user',
    component: User,
    meta: {
      title: titleMap['user']
    }
  },
  password: {
    path: 'password',
    name: 'password',
    component: Password,
    meta: {
      title: '修改密码',
      parentTitle: titleMap['person']
    }
  }
}

let router = new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})


export default router
